<include file="public@header" />
</head>
<body>
    <div class="layui-fluid">
        
            <!-- <li><a href="{:url('mailer/template')}?template_key=verification_code">数字验证码邮件模板</a></li> -->
        <form method="post" class="layui-form js-ajax-form margin-top-20" action="{:url('Admin/mailer/indexPost')}">
            <div class="layui-card">
                <div class="layui-card-header">{:lang('ADMIN_MAILER_INDEX')}</div>
                <div class="layui-card-body">
                    <div class="layui-form-item">
                        <label for="input-from_name" class="control-label layui-col-md2"><span class="form-required">*</span>{:lang('SENDER_NAME')}</label>
                        <div class="layui-col-md10">
                            <input type="text" class="layui-input" id="input-from_name" name="from_name" value="{$from_name|default=''}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="input-from" class="control-label layui-col-md2"><span class="form-required">*</span>{:lang('SENDER_EMAIL_ADDRESS')}</label>
                        <div class="layui-col-md10">
                            <input type="text" class="layui-input" id="input-from" name="from" value="{$from|default=''}">
                            <p class="layui-word-aux">记录了这封邮件来自哪个或哪些人的地址,但并不一定是邮件的发送人</p>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="input-host" class="control-label layui-col-md2"><span class="form-required">*</span>{:lang('SENDER_SMTP_SERVER')}</label>
                        <div class="layui-col-md10">
                            <input type="text" class="layui-input" id="input-host" name="host" value="{$host|default=''}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="js-smtpsecure" class="control-label layui-col-md2"><span class="form-required">*</span>连接方式</label>
                        <div class="layui-col-md10">
                            <select name="smtp_secure" id="js-smtpsecure"  class="layui-input">
                                <option value="">默认</option>
                                <option value="ssl">ssl</option>
                                <option value="tls">tls</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="input-port" class="control-label layui-col-md2"><span class="form-required">*</span>SMTP服务器端口</label>
                        <div class="layui-col-md10">
                            <input type="text" class="layui-input" id="input-port" name="port" value="{$port|default=''}" placeholder="默认为25">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="input-login_name" class="control-label layui-col-md2"><span class="form-required">*</span>{:lang('SMTP_MAIL_ADDRESS')}</label>
                        <div class="layui-col-md10">
                            <input type="text" class="layui-input" id="input-login_name" name="username" value="{$username|default=''}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="input-password" class="control-label layui-col-md2"><span class="form-required">*</span>{:lang('SMTP_MAIL_PASSWORD')}</label>
                        <div class="layui-col-md10">
                            <input type="password" class="layui-input" id="input-password" name="password" value="{$password|default=''}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="input-inbox-account" class="control-label layui-col-md2"><span class="form-required">*</span>收件箱帐号</label>
                        <div class="layui-col-md10">
                            <input type="text" class="layui-input" id="input-inbox-account" name="recipient_mailbox" value="{$recipient_mailbox|default=''}">
                            <p class="layui-word-aux">接收网站前台游客留言的邮箱地址(投资者关系栏目下的投资咨询)</p>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-col-md-offset2 layui-col-md10">
                            <button type="submit" class="layui-btn layui-btn-normal js-ajax-submit">{:lang('SAVE')}</button>
                            <a class="layui-btn layui-btn-warm" href="javascript:parent.openIframeDialog('{:url('mailer/test')}','发送测试邮件',{width:'600px',height:'400px'});">测试邮件</a>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>

<include file="public@footer"/>
<script>
    $(function(){
        $('#js-smtpsecure').val("{$smtp_secure|default=''}");
    });
</script>
